<?php

include_once("../model/Content.php");
include_once("../utils/ContentType.php");

class Suggestion implements Content{

    private $contentType = ContentType::Suggestion;
    
    public $id;
    public $title;
    public $author;
    public $description;

    public function __construct($id, $title, $author, $description) {
        $this->id = $id;
        $this->title = $title;
        $this->author = $author;
        $this->description = $description;
    }
    
    // Getter and setters for $id, in the event that the visibility
    // of $id is changed in the future.
    public function setId($id) {
        if(is_numeric($id)) {
            $this->id = $id;
        }
    }
    
    public function getId() {
        return $this->id;
    }
    
    /**
     * Method: getContentType
     * 
     * @return ContentType The type of this Suggestion class, as a ContentType enum.
     */
    public function getContentType() {
        return $this->contentType;
    }
    
    /**
     * Method: accept
     * 
     * Allows a class (that implements the Command interface) to act on this
     * object.
     * 
     * @param Command $command
     * The object representation of a desired function call on this Suggestion
     * class. For example, to remove this Suggestion from the database, we might
     * have a corresponding DeleteSuggestionCommand class.
     */
    public function accept(Command $command) {
        $command->visit($this);
    }
}

?>